package com.sbeam.vo;

import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class SysResult {
    private Integer status;
    private String msg;
    private Object data;

    public static SysResult success(){
        SysResult sysResult = new SysResult();
        sysResult.setStatus(666).setMsg("访问成功");
        return sysResult;
    }

    public static SysResult success(Object obj){
        SysResult sysResult = new SysResult();
        sysResult.setStatus(666).setMsg("访问成功").setData(obj);
        return sysResult;
    }

    public static SysResult success(String msgs,Object obj){
        SysResult sysResult = new SysResult();
        sysResult.setStatus(666).setMsg(msgs).setData(obj);
        return sysResult;
    }

    public static SysResult failed(){
        SysResult sysResult = new SysResult();
        sysResult.setStatus(555).setMsg("服务器异常");
        return sysResult;
    }
    public static SysResult failedAdd(){
        SysResult sysResult = new SysResult();
        sysResult.setStatus(444).setMsg("用户名已存在");
        return sysResult;
    }
}
